import { createApp } from 'vue'
import { createPinia } from 'pinia'
import router from './router'
import App from './App.vue'
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/reset.css'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

import DataList from "@/components/DataList.vue";

const app = createApp(App)

app.component("DataList", DataList);

//全局注册图标组件
import * as antIcons from "@ant-design/icons-vue";

Object.keys(antIcons).forEach((key) => {
  // @ts-ignore
  app.component(key, antIcons[key]);
});

app.config.globalProperties.$antIcons = antIcons;

const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

app.use(pinia)
app.use(router)
app.use(Antd)

app.mount('#app')